package com.fyj.repository;

import com.fyj.pojo.MissionDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 钰杰
 * @className MissionDetailRepository
 * @description VX:FengYJ996
 * @date 2019/12/420:55
 */
public interface MissionDetailRepository extends JpaRepository<MissionDetail,Integer> {

    MissionDetail findByDetailid(String detailid);

    //改表名
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "UPDATE tb_mission_detail SET table_name = ?2 detailid = ?1")
    void flushTableName(String detailid,String targetTable);
}
